package com.yanqu.road.logic.activity.foxcard.game.sorcery;

import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;
import com.yanqu.road.utils.RandomHelper;

import java.util.List;

/**
 * 随机摧毁{0}张手牌，并获得{1}金币。
 */
public class FoxCardSorceryUse9 extends FoxCardSorceryUseBase {
    @Override
    protected boolean sorceryUse(FoxCardGameLogic gameLogic) {
        int num = sorceryConfig.getParamList().get(0);
        int gold = sorceryConfig.getParamList().get(1);
        if (gameLogic.getGameData().getHandCards().isEmpty()) {
            return false;
        }

        List<FoxHandCard> randomList = RandomHelper.getRandomList(gameLogic.getGameData().getHandCards(), num);
        gameLogic.destroyHandCards(randomList);

        gameLogic.goldChange(gold, null, null, eFoxCardTriggerType.REMOVE);
        return true;
    }
}
